package mapEditor.vo
{
	import mapEditor.view.MapAssetBase;
	import mapEditor.view.MapRoadPoint;

	public class MapGridVO
	{
		private var _roadType:int;
		private var _roadPoint:MapRoadPoint;
		private var _mapAssetBase:MapAssetBase;
		private var _mapAssetFloorBase:MapAssetBase;
		
		public function MapGridVO()
		{
		}
		
		/**
		 *格子路点类型(0:可行走;1:不可行走)
		 */
		public function get roadType():int
		{
			return _roadType;
		}
		
		/**
		 *格子路点类型(0:可行走;1:不可行走)
		 */
		public function set roadType(value:int):void
		{
			_roadType = value;
		}
		
		/**
		 *路点标识对象
		 */		
		public function get roadPoint():MapRoadPoint
		{
			return _roadPoint;
		}
		
		/**
		 *路点标识对象 
		 */
		public function set roadPoint(value:MapRoadPoint):void
		{
			_roadPoint = value;
		}

		/**
		 *当前格子摆放的地图资源对象(用与为贴近格子的地图资源，此对象引用只是为了方便对象查找) 
		 */		
		public function get mapAssetBase():MapAssetBase
		{
			return _mapAssetBase;
		}

		/**
		 *当前格子摆放的地图资源对象(用与为贴近格子的地图资源，此对象引用只是为了方便对象查找) 
		 */	
		public function set mapAssetBase(value:MapAssetBase):void
		{
			_mapAssetBase = value;
		}

		/**
		 *当前地表层格子摆放的地图资源对象(用与为贴近格子的地图资源，此对象引用只是为了方便对象查找)  
		 */		
		public function get mapAssetFloorBase():MapAssetBase
		{
			return _mapAssetFloorBase;
		}

		/**
		 *当前地表层格子摆放的地图资源对象(用与为贴近格子的地图资源，此对象引用只是为了方便对象查找)  
		 */
		public function set mapAssetFloorBase(value:MapAssetBase):void
		{
			_mapAssetFloorBase = value;
		}

		public function dispose():void
		{
			if(_roadPoint)
			{
				if(_roadPoint.parent) _roadPoint.parent.removeChild(_roadPoint);
				_roadPoint.dispose();
			}
			_roadPoint=null;
			
			if(_mapAssetBase)
			{
				if(_mapAssetBase.parent) _mapAssetBase.parent.removeChild(_mapAssetBase);
				_mapAssetBase.dispose();
			}
			_mapAssetBase=null;
			
			if(_mapAssetFloorBase)
			{
				if(_mapAssetFloorBase.parent) _mapAssetFloorBase.parent.removeChild(_mapAssetFloorBase);
				_mapAssetFloorBase.dispose();
			}
			_mapAssetFloorBase=null;			
		}
	}
}